/**
 * Created by Administrator on 2017/8/23.
 */
var express = require('express');
var router = express.Router();
var userController = require('../controllers/user');
var promise = require('../util/promise');

router.post('/login', promise(userController.login));
router.get('/logout', promise(userController.logout));
router.get('/checkLogin', promise(userController.checkLogin));
router.get('/cartList', promise(userController.cartList));
router.post('/deleteCart', promise(userController.deleteCart));
router.post('/editCart', promise(userController.editCart));
router.post('/editAllChecked', promise(userController.editAllChecked));
router.get('/addressList', promise(userController.addressList));
router.post('/setDefaultAddress', promise(userController.setDefaultAddress));
router.post('/deleteAddress', promise(userController.deleteAddress));
router.post('/addAddress', promise(userController.addAddress));
router.get('/getOrder', promise(userController.getOrder));
router.post('/payment', promise(userController.payment));
router.post('/getOrderTotal', promise(userController.getOrderTotal));
router.get('/getCartCount', promise(userController.getCartCount));

module.exports = router;
